import {controls} from "@/utils/const";
import {uploadAliyunOSS} from "@/utils/upload";
import BraftEditor from "braft-editor";

const App = props => {

  let {value} = props;
  let {setEditorState} = props.data;
  return (
    <BraftEditor
      controls={controls}
      style={{border: '1px solid #ddd', borderRadius: 4}}
      media={{uploadFn: uploadAliyunOSS, accepts: {audio: false}}}
      defaultValue={value}
      onChange={e => setEditorState(e)}
    />
  );
};

export default App;